const Koa = require('koa')
const bodyParser = require('koa-bodyparser')
const registerRouters = require('../router/index')
const cors = require('@koa/cors')
const static = require('koa-static')
const mount = require('koa-mount')
const { UPLOAD_PATH } = require('../config/path')
// 1.创建app
const app = new Koa()
// 2.使用路由
app.use(cors())
app.use(bodyParser())
app.use(mount('/uploads', static('./uploads')))
app.use(static('./dist'))
registerRouters(app)

module.exports = app
